# 指定CMake最低版本要求
cmake_minimum_required(VERSION 3.1.0)

# 设置项目名称
project(video_compressor)

# 设置C++标准为C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 如果是Windows系统，可能需要手动设置Qt路径
if(WIN32)
    set(CMAKE_PREFIX_PATH "C:/Qt/5.15.2/msvc2019_64")  # 根据实际Qt安装路径修改
endif()

# 启用Qt的自动MOC、RCC和UIC
set(CMAKE_AUTOMOC ON)  # 元对象编译器
set(CMAKE_AUTORCC ON)  # 资源编译器
set(CMAKE_AUTOUIC ON)  # UI编译器

# 查找Qt5的Widgets组件
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)

# 添加include目录
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/src
    ${Qt5Widgets_INCLUDE_DIRS}
)

# 添加可执行文件，并指定源文件
add_executable(video_compressor
    src/main.cpp
    src/mainwindow.cpp
    src/videocompressor.cpp
)

# 链接Qt5::Widgets库
target_link_libraries(video_compressor PRIVATE Qt5::Core Qt5::Widgets)

# 设置输出目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 